workspace(name = "examples_python")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# The local_repository() rule is used below because the workspaces referenced
# are all located within the Tink git repository.
#
# To replicate this setup in a workspace located in a separate repository, you
# can use the equivalent, commented-out http_archive() rules below as a
# starting point.
#
# See the Tink Python HOW-TO for more details:
#   https://github.com/google/tink/blob/master/docs/PYTHON-HOWTO.md


local_repository(
    name = "tink_base",
    path = "../..",
)
# http_archive(
#     name = "tink_base",
#     urls = ["https://github.com/google/tink/archive/master.zip"],
#     strip_prefix = "tink-master/",
# )

local_repository(
    name = "tink_py",
    path = "../../python",
)
# http_archive(
#     name = "tink_py",
#     urls = ["https://github.com/google/tink/archive/master.zip"],
#     strip_prefix = "tink-master/python",
# )

local_repository(
    name = "tink_cc",
    path = "../../cc",
)
# http_archive(
#     name = "tink_cc",
#     urls = ["https://github.com/google/tink/archive/master.zip"],
#     strip_prefix = "tink-master/cc",
# )


# Load Tink dependencies.

# NOTE: The Python dependencies have to be loaded first, as they rely on a
# newer version of rules_python.
load("@tink_py//:tink_py_deps.bzl", "tink_py_deps")
tink_py_deps()

load("@tink_py//:tink_py_deps_init.bzl", "tink_py_deps_init")
tink_py_deps_init("tink_py")

load("@tink_py_pip_deps//:requirements.bzl", tink_pip_install = "pip_install")
tink_pip_install()

load("@tink_base//:tink_base_deps.bzl", "tink_base_deps")
tink_base_deps()

load("@tink_base//:tink_base_deps_init.bzl", "tink_base_deps_init")
tink_base_deps_init()

load("@tink_cc//:tink_cc_deps.bzl", "tink_cc_deps")
tink_cc_deps()

load("@tink_cc//:tink_cc_deps_init.bzl", "tink_cc_deps_init")
tink_cc_deps_init()

# Use rules-python 0.2.0 which contains a pip_install that works with
# google-cloud-storage.
# See https://github.com/bazelbuild/rules_python/issues/93#issuecomment-710085646.
http_archive(
    name = "rules_python0.2.0",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.2.0/rules_python-0.2.0.tar.gz",
    sha256 = "778197e26c5fbeb07ac2a2c5ae405b30f6cb7ad1f5510ea6fdac03bded96cc6f",
)

load("@rules_python0.2.0//python:pip.bzl", "pip_install")

pip_install(
   name = "pip_deps",
   requirements = "@examples_python//:requirements.txt",
)
